<template>
  <div class="app">
    <header class="header">
      <div class="logo">BiliDouyin</div>
      <nav class="nav">
        <span>欢迎使用</span>
      </nav>
    </header>
    <div class="layout">
      <aside class="sidebar">
        <ul>
          <li :class="{active: $route.path.includes('/bili')}" @click="$router.push('/bili')">
            <span class="icon">🏠</span> BiliBli
          </li>
          <li :class="{active: $route.path.includes('/douyin')}" @click="$router.push('/douyin')">
            <span class="icon">📊</span> 抖音
          </li>
        </ul>
      </aside>
      <main class="content">
        <router-view />
      </main>
    </div>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router'
</script>

<style scoped>
.app {
  height: 95vh;
  display: flex;
  flex-direction: column;
  background: #f6f8fa;
}
.header {
  height: 56px;
  background: #22223b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 2px 8px rgba(34,34,59,0.04);
}
.logo {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #4ea1d3;
}
.nav span {
  font-size: 15px;
  color: #e0e1dd;
}
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}
.sidebar {
  width: 210px;
  background: #fff;
  border-right: 1px solid #e0e1dd;
  display: flex;
  flex-direction: column;
  padding-top: 32px;
  box-shadow: 2px 0 8px rgba(34,34,59,0.02);
}
.sidebar ul {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0 0 0 0;
  margin: 0;
}
.sidebar li {
  display: flex;
  align-items: center;
  padding: 12px 32px;
  font-size: 16px;
  color: #22223b;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sidebar li .icon {
  margin-right: 10px;
  font-size: 18px;
}
.sidebar li.active {
  background: linear-gradient(90deg, #4ea1d3 0%, #9fd3c7 100%);
  color: #fff;
  font-weight: bold;
}
.content {
  flex: 1;
  padding: 20px 28px;
  background: #f6f8fa;
  overflow: auto;
  border-radius: 12px;
  margin: 24px 24px 24px 0;
  box-shadow: 0 2px 16px rgba(34,34,59,0.04);
}
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; border-right: none; border-bottom: 1px solid #e0e1dd; padding-top: 0; }
  .sidebar ul { flex-direction: row; gap: 0; }
  .sidebar li { border-radius: 0; padding: 12px 16px; }
  .content { margin: 0; padding: 16px; }
}
</style> 